/**
 * @author scylla
 * @version V1.0
 * @Project echo-java-base
 * @Title 优先级Main函数
 * @Description *
 * @Package concurrent.mthread.priority
 * @Since 2021/7/27 1:17 下午
 */
package concurrent.mthread.priority;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class PriorityMain {

    public static void main(String[] args) {
        ExecutorService exec = Executors.newCachedThreadPool();
        for (int i = 0; i < 5; i++)
            //以最小优先级执行5次
            exec.execute(new SimplePriorities(Thread.MIN_PRIORITY));
        //以最大优先级执行一次
        exec.execute(new SimplePriorities(Thread.MAX_PRIORITY));



        //终止
        exec.shutdown();

    }
}
